# Maintainer: Eli Schwartz <eschwartz@archlinux.org>

_pkgname=css-parser
pkgname=python-css-parser
pkgver=1.0.8
pkgrel=3
pkgdesc="A CSS Cascading Style Sheets library for Python"
arch=('any')
url="https://github.com/ebook-utils/${_pkgname}"
license=('LGPL')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest')
source=("https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/${_pkgname}/${_pkgname}-${pkgver}.tar.gz"{,.asc})
sha512sums=('1b22665a172b8a29e277217f39bac1512867dbd5acdfe37ddf078eab71452467adc3dcdac68e424df32cc204f3e55da45d31663f8e7aa143c0243818df32487a'
            'SKIP')
validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C') # Kovid Goyal (New longer key) <kovid@kovidgoyal.net>

build() {
  cd ${_pkgname}-${pkgver}

  python -m build --wheel --no-isolation
}

check() {
  cd ${_pkgname}-${pkgver}

  PYTHONPATH="$PWD"/src \
  pytest -v
}

package() {
  cd ${_pkgname}-${pkgver}

  python -m installer --destdir="${pkgdir}" dist/*.whl
}
